﻿package nl.sanity.puremvc.controller
{
    import org.puremvc.as3.interfaces.INotification;
    import org.puremvc.as3.patterns.command.SimpleCommand;
    import org.puremvc.as3.patterns.observer.Notification;
	import org.puremvc.as3.utilities.startupmanager.model.StartupMonitorProxy;
	
	import nl.sanity.debug.LogConsole;
    
    /**
	 * StartupResourceFailedCommand
	 * Called when one of the initially necessary resources fails to load.
	 * 
	 * @langversion ActionScript 3
	 *
	 * @author A. Gosman
	 * @since  28/03/2009
	 */
    public class StartupResourceFailedCommand extends SimpleCommand
    {
    	// --- OVERRIDE FUNCTIONS ----------------------------------------

        override public function execute( notification:INotification ):void
		{
            LogConsole.error ( "StartupResourceFailedCommand.execute" );
			
			var monitor:StartupMonitorProxy		= facade.retrieveProxy ( StartupMonitorProxy.NAME ) as StartupMonitorProxy;
			monitor.resourceFailed ( notification.getBody().toString() );
        }
    }
}